﻿using System.Configuration;
using System.Linq;
using ZilLion.Core.Unities.UnitiesMethods.WebApi.Http;
using ZilLion.Task.Domain.Taskmanager.Entity;
using ZilLion.Task.Domain.Taskmanager.Response;
using ZilLion.Task.Domain.WebEntity;

namespace ZilLion.Task.Domain.Taskmanager.Repository
{
    public class TaskStateRespository : WebApiRepositoryBase<HttpNoCompressionClient>
    {
        public TaskStateResponse GetTaskStateById(string taskid,string nodeid=null)
        {
           
            var url =
                $"Api/TaskState/GetTaskState/{taskid}/{nodeid}";
            return HttpGet<TaskStateResponse>(url);
            
        }
        public TaskStateResponse GetAllTaskState ( string nodeid )
        {

            var url =
                $"Api/TaskState/GetAllTaskState?{nodeid}";
            return HttpGet<TaskStateResponse>(url);

        }

        
        public void UpdateTaskState(TaskStateEntity stateEntity)
        {
            var url =
                $"Api/TaskState/UpdateTaskState";
            HttpPost<TaskStateEntity, ResponseResultInfo>(stateEntity, url);
        }
    }
}